package com.xxl.sso.sample.controller;

import com.xxl.sso.sample.shiro.AccountProfile;
import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {

    @GetMapping("/admin/info")
    public Object getAdminInfo() {

        Object principal = SecurityUtils.getSubject().getPrincipal();
        AccountProfile user = (AccountProfile) principal;

        return user;
    }

}
